About QuickDraw GX Printing
Printing with QuickDraw GX involves the interaction of your application program with components that QuickDraw GX provides, or components that may be provided by a printer manufacturer or other vendor. These components are
QuickDraw GX actually performs most of the translation work itself so that the developer of a printer driver or printing extension can concentrate on the unique features or characteristics of a printing device. As an application developer, your work primarily consists of responding to printing-related menu selections and dialog boxes within the application.
- printer drivers that translate QuickDraw GX shapes into instructions for rendering the shapes on a device
- printing extensions that provide additional capabilities for the printing system
To understand the division of labor, consider the model of QuickDraw GX printing phases in Figure 1-1.
Figure 1-1 QuickDraw GX printing phases
There are four phases of printing:
As an application developer, you are primarily concerned with the application phase of printing. You may be interested indirectly in events in other phases because some of those events can be controlled by the application. For example, your application can provide alternative instructions for rendering output, rather than use the instructions generated by the printer driver. These alternative instructions are called synonyms. As another example, the application can retrieve and modify the contents of a file after it has been spooled.
- The application phase, in which the application calls QuickDraw GX functions in response to the user choosing a menu item or changing an item in a dialog box. For example, when the user selects Print from the menu, the application calls functions to display the Print dialog box and respond to the user's choices. One of the application's responses is to print the requested pages of a document, which leads to the spooling phase of printing.
- The spooling phase, in which the requested pages are placed in a spool file. The application calls QuickDraw GX functions to perform this task, which is carried out collaboratively by QuickDraw GX, the printer driver, and any printing extensions that are active. From the application developer's point of view, it is seldom necessary to know how the work is divided between QuickDraw GX, a printer driver, or a printing extension. Thus, in this book, all collaborative efforts by these components are considered as being performed by the printer driver.
- The imaging phase, in which the requested pages are despooled by the printer driver and the contents are translated into instructions for the printer.
- The device communications phase, in which the instructions are actually sent to the printer hardware.
This book provides all the information you need to implement QuickDraw GX printing in an application. For information about implementing printer drivers or printing extensions, see Inside Macintosh: QuickDraw GX Printing Extensions and Drivers. The following sections introduce topics that provide conceptual background for implementing QuickDraw GX printing features. The topics are
- Core printing-related objects, which are objects that are used in every application and work together to support QuickDraw GX printing.
- Desktop printers, which represent printers to the user as icons on the desktop.
- Print files, which are the output of the spooling phase. A special kind of print file that can be opened and displayed without needing the fonts or application with which it was created is called a portable digital document, or PDD.
- Printer drivers, which are responsible for defining the characteristics of the printing environment in addition to providing translation between the QuickDraw GX graphics representation of a page and the instructions that render it on a printer.
- Printing extensions, which are add-on software that provide an additional level of customization to QuickDraw GX printing.
- Dialog boxes, which are extensible in QuickDraw GX and, if extended, use additional resource types. Dialog boxes also require additional support because they are movable, requiring the screen behind them to be redrawn when they are moved.
- Message passing, which is the basic technique used by the QuickDraw GX printing system to communicate between the application, printer driver, and printing extensions. It is also the technique used to notify the application when dialog boxes are moved.
Subtopics
- Core Printing-Related Objects
- Desktop Printers
- Print Files
- Printer Drivers
- Printing Extensions
- Dialog Boxes
- Message Passing
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help